<template>
  <div class="ad" v-if="this.list.length">
      <div class="ad-title">本次投票人信息</div>
      <div class="table">
         <tr>
              <th class="table-item">用户ID</th>
              <th class="table-item">用户名</th>
              <th class="table-item">密码</th>
             <!--  <th class="table-item">编辑</th>
              <th class="table-item delete">选择</th> -->
         </tr>
         <tr v-for="(item, index) in list" :key="item.vId" :ref="index">
            <th class="table-item">{{item.vId}}</th>
            <th class="table-item">{{item.vName}}</th>
            <th class="table-item">{{item.vPassword}}</th>
           <!--  <th class="table-item alter" @click="handleAlter(item,index)">修改用户信息</th>
            <th class="table-item delete">
                <input type="checkbox" value="checked"
                v-model="select[index]"
                @click="handleSelectClick(index)">
            </th> -->
        </tr>
      </div>
      <common-pagination @curPageChanged="handlecurPageChanged" :totalData="totalData">
        </common-pagination>
  </div>
</template>

<script>
// import axios from 'axios'
// import { mapState } from 'Vuex'
import CommonPagination from 'common/Pagination'
export default {
  name: 'admin',
  components: {
    CommonPagination
  },
  props: {
    list: Array,
    totalData: String,
    totalPages: String
  },
  data () {
    return {
      select: [],
      delete: []
    }
  },
  methods: {
    handlecurPageChanged (curPage) {
      this.curPage = curPage
      this.$emit('pageChange', this.curPage)
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~style/variable.styl'
.ad
    margin-top: 1rem
    text-align: center
    padding: 0 .5rem
    .ad-title
        outline-top: dashed #000
        background: $bgcolor
        color: #fff
        line-height: $height
        text-align: center
        margin-bottom: .5rem
    .table
        margin-top: .5rem
        width: 100%
        .table-item
            border: .02rem solid #aaa
            width: 12rem
            // width: 23.95% /* 设置百分比失效 */
            height: .5rem
            line-height: .5rem
            padding: .2rem .0rem
        .alter
            color: $bgcolor
        .delete
            width: 1rem
</style>
